package com.cloud.observer;


import com.cloud.observer.example.TestScheduledErrorLogHandler;
import com.cloud.observer.handler.successHandler.TestScheduledSuccessHandler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;

/**
 * @author: create by God of SJF
 * @version: v1.0
 * @description: com.cloud.observer
 * @date:2021/1/12
 */
public class ScheduledObserverAutoConfiguration {

    @Autowired
    ApplicationContext applicationContext;

    @Bean
    public ScheduledObserverAspect scheduledObserverAspect() {
        return new ScheduledObserverAspect();
    }

    @Bean
    public ScheduledObserverWrapper scheduledObserverWrapper() {
        return new ScheduledObserverWrapper();
    }

    @Bean
    public BaseScheduledObserver baseScheduledObserver() {
        return new BaseScheduledObserver();
    }

    @Bean
    public ScheduledObserverRefresher scheduledObserverBuilder() { return new ScheduledObserverRefresher(); }

    @Bean
    public ScheduledExceptionHandler scheduledExceptionHandler(){return new ScheduledExceptionHandler();}

    @Bean
    public TestScheduledErrorLogHandler testScheduledErrorLogHandler(){return new TestScheduledErrorLogHandler();}

    @Bean
    public TestScheduledSuccessHandler testScheduledSuccessHandler(){return  new TestScheduledSuccessHandler();}
}
